Skip to content

Change Symbol to VariableReferenceExpression in PlanNode#12606

Merged
rongrong merged 55 commits intoprestodb:masterfrom
rongrong:symbol-to-variable
Jun 11, 2019
Merged

Change Symbol to VariableReferenceExpression in PlanNode#12606
rongrong merged 55 commits intoprestodb:masterfrom
rongrong:symbol-to-variable

Conversation

@rongrong
Copy link
Contributor

@rongrong rongrong commented Apr 7, 2019

Step 1: Add outputVariables to all PlanNode while keeping outputSymbols. No logic change.
Step 2: Start using outputVariables instead of outputSymbols in planning / optimization.
Step 3: Remove outputSymbols.

This will take a while. I might or might not get it done eventually... -_-

@rongrong rongrong force-pushed the symbol-to-variable branch 4 times, most recently from da62e2a to d8e7dd7 Compare April 7, 2019 07:46
Copy link
Contributor

@hellium01 hellium01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is so great that some one finally are trying to tackle this problem :) No more typeProviders!!!

Copy link
Contributor

@hellium01 hellium01 Apr 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be VariableReference as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Symbol in all PlanNode should be variables. They can't all happen in one diff.

Copy link
Contributor

@hellium01 hellium01 Apr 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need outputSymbols here. We can convert to List<Symbol> from List<VariableReferenceExpression> very easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that first. It means a lot of unnecessary code change. I think adding variable separate from symbol then remove symbol is cleaner.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we need to do this conversion very frequently, add a utility function in symbolAllocator to get VariableReferenceExpression?

context.getSymbolAllocator().newSymbol(...);
context.getSymbolAllocator().getVariableReference(symbol);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really matter. However you write it now, eventually these will be changed again. None of these will be here once the refactor is done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just replace all internal Symbol to Variable? We can do a conversion whenever we can getOutput.

Copy link
Contributor Author

@rongrong rongrong Apr 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can get that work feel free to do so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to have duplicated makerSymbol and markerVariable in constructor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distinctSymbols/hashSymbol should be VariableReference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing at a time. Otherwise each diff will be huge.

@rongrong rongrong force-pushed the symbol-to-variable branch 3 times, most recently from b1e1b27 to 5b97f9f Compare April 9, 2019 00:29
@rongrong
Copy link
Contributor Author

rongrong commented Apr 9, 2019

Not ready for review, only for entertainment. ^_^

@rongrong rongrong force-pushed the symbol-to-variable branch 14 times, most recently from 32fbc88 to e99e7fc Compare April 16, 2019 00:31
@rongrong rongrong force-pushed the symbol-to-variable branch 6 times, most recently from 264493d to 191d74e Compare April 17, 2019 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants